﻿''' <summary>
''' Helper class to associate collector/writer and plugin objects.
''' </summary>
''' <typeparam name="T"></typeparam>
''' <remarks></remarks>
Public Class ObjectRef(Of T)

    ''' <summary>
    ''' Collector/writer object.
    ''' </summary>
    ''' <remarks></remarks>
    Protected m_object As T

    ''' <summary>
    ''' Plugin object.
    ''' </summary>
    ''' <remarks></remarks>
    Protected m_plugin As Plugin

    ''' <summary>
    ''' Get/set the collector/writer object.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property [Object]() As T
        Get
            Return m_object
        End Get
        Set(ByVal value As T)
            m_object = value
        End Set
    End Property

    ''' <summary>
    ''' Get/set the plugin object.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Plugin() As Plugin
        Get
            Return m_plugin
        End Get
        Set(ByVal value As Plugin)
            m_plugin = value
        End Set
    End Property

    ''' <summary>
    ''' Default class constructor.
    ''' </summary>
    ''' <param name="Object">Collector/writer object.</param>
    ''' <param name="plugin">Plugin object.</param>
    ''' <remarks></remarks>
    Public Sub New(ByVal [Object] As T, ByVal plugin As Plugin)
        m_object = [Object]
        m_plugin = plugin
    End Sub

End Class
